import request from "../../../utils/request";

enum API {
  saveSkuInfoUrl = "/admin/product/saveSkuInfo",
  findBySpuIdUrl = "/admin/product/findBySpuId/",
  skuInfoList = "/admin/product/list/",
  getSkuInfo = "/admin/product/getSkuInfo/",
}

export const reqSaveSkuInfo = (skuInfo: any) =>
  request.post(API.saveSkuInfoUrl, skuInfo);

export const reqFindSkuBySpuId = (spuId: number) =>
  request.get(API.findBySpuIdUrl + spuId);

export const reqSkuInfoList = (page: number, limit: number) =>
  request.get(API.skuInfoList + `${page}/${limit}`);

export const reqGetSkuInfo = (skuId: number) =>
  request.get(API.getSkuInfo + skuId);
